//////////////////////////////////////////////////
// EASIM project
// easim.mobi.Teleport
// 6/15/2007 5:10 PM
// Cong Liu
// gzcong@gmail.com

// Copyright (C) 2007
// All rights reserved.
// Refer to LICENSE of JIST (Java In Simulation Time) for terms and conditions of use.

package easim.mobi;

import jist.runtime.JistAPI;
import jist.swans.Constants;
import easim.net.Node;

public class Teleport extends Mobility implements JistAPI.DoNotRewrite
{

  ///////////////////////////////////
  // Teleport Configuration
  //

  public static long MIN_PAUSE_TIME = 1 * Constants.SECOND;
  public static long MAX_PAUSE_TIME = 10 * Constants.SECOND;
  public static int WIDTH = 800;
  public static int HEIGHT = 600;

  ///////////////////////////////////
  // Random Waypoint Data
  //

  public Teleport(Node node) {
    super(node);
  }

  public void start() {
    super.start();
  }

	public Movement next() {
    Movement movement = new Movement();
    movement.x = (float)Constants.random.nextFloat() * WIDTH;
    movement.y = (float)Constants.random.nextFloat() * HEIGHT;
    movement.delay = MIN_PAUSE_TIME + (long)((MAX_PAUSE_TIME - MIN_PAUSE_TIME) * Constants.random.nextDouble());
    return movement;
	}

}
